<%@page contentType="text/html;charset=utf-8"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
ul li {
	text-decoration: none;
	list-style-type: none;
	line-height: 20px;
}

body {
	font-family: 宋体, Arial, Helvetica, sans-serif;
	font-size: 12px;
	background: #769b72 url(images/booksaleimg/bg_grad.gif) top center
		no-repeat;
	cursor: default;
	color: #404040;
	margin: 0;
	padding: 0;
}

			#f{
				border: 1px red dashed;
				background-color: aqua;
			}
			#f1{
				border: 1px red dashed;
				background-color: aqua;
			}
			.first{
				width: 20%;
				text-align: center;
				color: #C12E2A;
			}
			.second{
				width: 80%;
				padding-bottom: 0px;
			}
			tr{
				height: 80px;
			}
			table{
				width: 900px;
			}
			.huifu{
				margin-left: 400px;
				background-color: gainsboro;
			}
			.name{
				color: #C12E2A;
			}
			.comment{
				padding-left:55px;
			}
</style>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.12.4.js"></script>
<script type="text/javascript">
	$(function(){
		$("[name='buy']").click(function(){
			var img=$(this);
			var bookId=img.prev().html();
			alert(bookId);
			img.prop("src","${pageContext.request.contextPath}/cart/cart_addCart?bookId="+bookId);
			window.setTimeout(function(){
				img.prop("src","${pageContext.request.contextPath}/images/load.gif")
			},500);
			window.setTimeout(function(){
				img.prop("src","${pageContext.request.contextPath}/images/label3.gif")
			},1000);
			window.setTimeout(function(){
				img.prop("src","${pageContext.request.contextPath}/images/buttom_goumai.gif")
			},1500);
		});
	})
	</script>
</head>
<body>
	<div style="width: 60%;margin:20px auto;">
		<div style="width:100%;float: left;">
			<h1>
				
			</h1>
			<span><font color="#cccccc">丛书名：<s:property value="b.bookName"/></font></span>
			<hr />
			<div>
				<div style="float: left;width:20%;">
					<img src="${pageContext.request.contextPath }/<s:property value="b.bookImg"/>"  border=0 />
				</div>
				<div style="float: left;width:80%">
					<ul class="info">
						<li>作&nbsp;者：<s:property value="b.author"/></li>
						<li>出版社：<s:property value="b.press"/></li>
						<li style="float:left;width:50%;">出版时间：<s:property value="b.update"/></li>
						<li style="float:left;width:50%;">字数：</li>
						<li style="float:clear;"></li>
						<li>
							<div class='your_position'>
								您现在的位置:&nbsp; 
								<a href='${pageContext.request.contextPath }/book/book_show'>当当图书</a> &gt;&gt;
								<a href='${pageContext.request.contextPath }/book/book_showBySCategory?categoryId=<s:property value="b.category.categoryId"/>'>
									<s:property value="b.category.categoryName"/>
								</a> &gt;&gt; 
								<font style='color: #cc3300'> 
									<strong> 
									</strong>
								</font>
							</div>
						</li>
						<li>定价：￥<s:property value="b.bookPrice"/>&nbsp;&nbsp;
							当当价：￥<s:property value="b.dangPrice"/>&nbsp;&nbsp; 
							节省：￥<s:property value="b.bookPrice-b.dangPrice"/></li>
						<li><a href="javascript:void(0)"> 
							<span style="display:none"><s:property value="b.bookId"/></span>
							<img src='../images/buttom_goumai.gif' class="abc" name="buy"/>
						</a></li>
					</ul>
				</div>
				<div style="float: clear;"></div>
			</div>
		</div>
		
		
		<div>
			<fieldset id="f">
				<legend id="f1">用户评论区</legend>
				<table id="table" border="1"  cellpadding="4" cellspacing="0">
				<tbody><c:forEach items="${requestScope.comment }" var="co">
				<tr>
					<td class="first">${co.nickname }</td>
					<td class="second">${co.message }
						<div class="huifu">
							<c:forEach items="${co.co }" var="com">
							<p><span class="name">${com.nickname }:</span>${com.message }     </p>
							<p align="right"><fmt:formatDate value="${com.codate }"  pattern="yyyy年MM月dd日"/></p>
						</c:forEach>
						</div><form style="display:none">
					<p align="right"><textarea name="content1" style="width:400px;height:100px;"></textarea></p><p align="right"><a href="javascript:void(0)" name="up">收起↑↑↑↑</a><input type="button" name="getHtml1" value="评论" /><span style="display:none">${co.id }</span>
					</p>
					</form><p align="right">${co.floor }楼   <fmt:formatDate value="${co.codate }"  pattern="yyyy年MM月dd日"/><a href="javascript:void(0)" name="reply">回复</a></p>
					</td>
				</tr>
				</c:forEach>
				
			</tbody></table>
			</fieldset>
		</div>
		<div class="comment">
			<form>
			<textarea name="content" style="width:800px;height:400px;visibility:hidden;"></textarea>
			<p>
				<input type="button" name="getHtml" value="评论" />
			</p>
			</form>
		</div>
	</div>
</body>
</html>